#!/bin/bash
QT_JAMBI_VERSION=4.3.3_01
export QTJAMBI_VERSION

GROUP_ID=ech.trolltech
QT_JAMBI_LINUX_NATIVE_32_ARTIFACT_ID=qtjambi-native-linux-32
QT_JAMBI_WIN_NATIVE_32_ARTIFACT_ID=qtjambi-native-win-32
QT_JAMBI_MAC_NATIVE_32_ARTIFACT_ID=qtjambi-native-mac-32
QT_JAMBI_ARTIFACT_ID=qtjambi

QT_JAMBI_WIN_32_DIR=qtjambi-win32-gpl-$QT_JAMBI_VERSION
QT_JAMBI_WIN_32_FILE=$QT_JAMBI_WIN_32_DIR.zip
QT_JAMBI_WIN_32_URL=ftp://ftp.trolltech.com/qtjambi/source/$QT_JAMBI_WIN_32_FILE
export QT_JAMBI_WIN_32_URL

QT_JAMBI_LINUX_32_DIR=qtjambi-linux32-gpl-$QT_JAMBI_VERSION
QT_JAMBI_LINUX_32_FILE=$QT_JAMBI_LINUX_32_DIR.tar.gz
QT_JAMBI_LINUX_32_URL=ftp://ftp.trolltech.com/qtjambi/source/$QT_JAMBI_LINUX_32_FILE
export QT_JAMBI_LINUX_32_URL

QT_JAMBI_MAC_32_DIR=qtjambi-mac-gpl-$QT_JAMBI_VERSION
QT_JAMBI_MAC_32_FILE=$QT_JAMBI_MAC_32_DIR.tar.gz
QT_JAMBI_MAC_32_URL=ftp://ftp.trolltech.com/qtjambi/source/$QT_JAMBI_MAC_32_FILE
export QT_JAMBI_LINUX_32_URL






# clean
rm $QT_JAMBI_LINUX_32_FILE
rm -r $QT_JAMBI_LINUX_32_DIR

rm $QT_JAMBI_WIN_32_FILE
rm -r $QT_JAMBI_WIN_32_DIR

rm $QT_JAMBI_MAC_32_FILE
rm -r $QT_JAMBI_MAC_32_DIR

rm *.jar 

# Download binary distribution 
wget $QT_JAMBI_LINUX_32_URL
wget $QT_JAMBI_WIN_32_URL
wget $QT_JAMBI_MAC_32_URL


# Linux
# Extract distribution
tar -xvzf $QT_JAMBI_LINUX_32_FILE
rm -rf stage
mkdir stage
cd stage
# copy linux 32 natives file
cp ../$QT_JAMBI_LINUX_32_DIR/lib/* .
jar cf ../qtjambi-native-32-linux.jar .
cd ..

# Extract distribution
unzip $QT_JAMBI_WIN_32_FILE


rm -rf stage
mkdir stage
cd stage
# copy win32 native files
cp ../$QT_JAMBI_WIN_32_DIR/bin/*.dll .

jar cf ../qtjambi-native-32-win.jar .

cd ..

# Extract distribution
tar -xvzf $QT_JAMBI_MAC_32_FILE
rm -rf stage
mkdir stage
cd stage
# copy mac 32 natives file
cp ../$QT_JAMBI_MAC_32_DIR/lib/* .


jar cf ../qtjambi-native-32-mac.jar .

cd ..




exit


